Long-term scenarios of daily deaths
CZ_expected_deaths_timeline_projected_end <- CZ_expected_deaths_timeline_projected %>%
filter(date_expected_death == as.Date("30/11/2020", format = "%d/%m/%Y"))
CZ_expected_deaths_timeline_projected_summary <- CZ_expected_deaths_timeline_projected %>%
mutate(month = month(date_expected_death)) %>%
group_by(month, Scenario) %>%
summarise(expected_deaths = sum(expected_deaths))
ggplotly(
CZ_expected_deaths_timeline_projected %>%
left_join(CZ_all, by = c("date_expected_death" = "date")) %>%
filter(date_expected_death <= as.Date("30/11/2020", format = "%d/%m/%Y")) %>%
ggplot(aes(x = date_expected_death, y = round(expected_deaths_7,2), col = Scenario)) +
geom_line(size = 1) +
geom_text_repel(aes(label = round(expected_deaths_7,0), colour = Scenario), data = CZ_expected_deaths_timeline_projected_end, size = 3, vjust = 0, hjust = -200) +
#geom_line(aes(y = expected_deaths), col = "grey10") +
geom_line(aes(y = new_deaths_7), col = "black", size = 1) +
geom_vline(xintercept = date_model, col = "red", linetype = "dashed") +
scale_color_manual(values = c("#377EB8", "#4DAF4A", "purple", "#E41A1C")) +
scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 week", date_labels="%b") +
theme_light() +
theme(panel.grid.minor = element_blank(),
legend.position = "bottom") +
guides(color=guide_legend(nrow=2,byrow=TRUE)) +
labs(y = "Deaths (7 day rolling average)", x = "", title = "Long-term scenarios of expected daily deaths", subtitle = "Based on past data and 4 scenarios of growth in cases")
) %>%
layout(legend = list(
orientation = "h",
x = -0,
y = -0.1
)
)
CZ_expected_deaths_timeline_projected_end <- CZ_expected_deaths_timeline_projected %>%
filter(date_expected_death == as.Date("30/11/2020", format = "%d/%m/%Y"))
CZ_expected_deaths_timeline_projected_summary <- CZ_expected_deaths_timeline_projected %>%
mutate(month = month(date_expected_death)) %>%
group_by(month, Scenario) %>%
summarise(expected_deaths = sum(expected_deaths))
CZ_expected_deaths_timeline_projected %>%
left_join(CZ_all, by = c("date_expected_death" = "date")) %>%
filter(date_expected_death <= as.Date("30/11/2020", format = "%d/%m/%Y")) %>%
ggplot(aes(x = date_expected_death, y = round(expected_deaths_7,2), col = Scenario)) +
geom_line(size = 1) +
geom_text_repel(aes(label = round(expected_deaths_7,0), colour = Scenario), data = CZ_expected_deaths_timeline_projected_end, size = 3, vjust = 0, hjust = -1) +
#geom_line(aes(y = expected_deaths), col = "grey10") +
geom_line(aes(y = new_deaths_7), col = "black", size = 1) +
geom_vline(xintercept = date_model, col = "red", linetype = "dashed") +
scale_color_manual(values = c("#377EB8", "#4DAF4A", "purple", "#E41A1C")) +
scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 week", date_labels="%b") +
theme_light() +
theme(panel.grid.minor = element_blank(),
legend.position = "bottom") +
guides(color=guide_legend(nrow=2,byrow=TRUE)) +
labs(y = "Deaths (7 day rolling average)", x = "", title = "Long-term scenarios of expected daily deaths", subtitle = "Based on past data and 4 scenarios of growth in cases")
